package concurrency.chapter2;

public class TicketWindowRunnable implements Runnable{
    private static final int MAX = 50;
    //static可以实现多个线程访问同一个数据，不会出现重复数据，但生命周期太长
    private static int index = 1;

    @Override
    public void run() {
        while (index <= MAX)
            System.out.println(Thread.currentThread().getName() + "的号码是：" + index++);
    }
}
